/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.csource.manage.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.icinfo.cloud.provider.punish.csource.manage.mapper.CaseSourceRegisterDetailInfoMapper;
import com.icinfo.cloud.provider.punish.csource.manage.model.CaseSourceRegisterDetailInfo;
import com.icinfo.cloud.provider.punish.csource.manage.service.ICaseSourceRegisterDetailInfoService;
import com.icinfo.framework.core.service.support.MyBatisServiceSupport;
import com.icinfo.framework.mybatis.mapper.entity.Example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述: 案源登记详情表 case_source_register_detail_info 对应的Service接口实现类.<br>
 *
 * @author framework generator
 * @date 2022年08月12日
 */
@Service
public class CaseSourceRegisterDetailInfoServiceImpl extends MyBatisServiceSupport implements ICaseSourceRegisterDetailInfoService {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(CaseSourceRegisterDetailInfoServiceImpl.class);

    @Autowired
    private CaseSourceRegisterDetailInfoMapper caseSourceRegisterDetailInfoMapper;

    @Override
    public CaseSourceRegisterDetailInfo getCaseSourceRegisterDetailInfoByCaseSourceId(String caseSourceId) {
        Example example =new Example(CaseSourceRegisterDetailInfo.class);
        example.createCriteria().andEqualTo("caseSourceId",caseSourceId);
        List<CaseSourceRegisterDetailInfo> caseSourceRegisterDetailInfos = caseSourceRegisterDetailInfoMapper.selectByExample(example);
        if (ObjectUtil.isNotEmpty(caseSourceRegisterDetailInfos) && caseSourceRegisterDetailInfos.size()>0){
            return caseSourceRegisterDetailInfos.get(0);
        }
        return null;
    }
}
